package wangjg.security.resource.factory.xml2.entity;

import java.util.LinkedHashSet;
import java.util.Set;

import wangjg.security.core.AuthoritySet;

/**
 * 用户
 * @author wangjg
 */
public class User implements AuthoritySet, java.io.Serializable {
	private static final long serialVersionUID = 1L;

	private Long id; //id
	
	private String username;//用户名

	private String password;//密码

	private Set<String> roles = new LinkedHashSet<String>();

	public User() {
	}
	
	public Set<String> getAuthorities() {
		return roles;
	}
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	public Set<String> getRoles() {
		return roles;
	}
	public void setRoles(Set<String> roles) {
		this.roles = roles;
	}
	@Override
	public String toString() {
		return "\nUser [id=" + id + ", username=" + username + ", password="
				+ password + "]";
	}
}
